package base;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.*;
import helper.request.*;

public class Log implements Serializable{
	private static final long serialVersionUID = -1403417652517014421L;
	private Date date;
    private String description;
    private int userid;
    
    public Log(String s){
    	Calendar c=Calendar.getInstance();
		SimpleDateFormat f=new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		date=c.getTime();
		String mydate=f.format(date);
    	description=mydate+": "+s;
    }
    public Log(int a,String b,Date c){
    	setUserid(a);
    	description=b;
    	date=c;
    }
    public Log(RequestAfterLogin event){
    	Calendar c=Calendar.getInstance();
		SimpleDateFormat f=new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		date=c.getTime();
		String mydate=f.format(date);
    	description=mydate+": "+event.toString();
    }
    
    public Date getDate(){
    	return date;
    }
    
    public String toString(){
    	return description;
    }
	public void setUserid(int userid) {
		this.userid = userid;
	}
	public int getUserid() {
		return userid;
	}
}
